home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16652 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: sunsite.doc.ic.ac.uk!cs.york.ac.uk
  2. From: John Kennedy <johnk@cs.york.ac.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: C++ guru sought ...
  5. Message-ID: <316CB5B5.41C6@cs.york.ac.uk>
  6. Date: Thu, 11 Apr 1996 08:33:09 +0100
  7. Organization: Department of Computer Science
  8. MIME-Version: 1.0
  9. Content-Type: text/plain; charset=us-ascii
  10. Content-Transfer-Encoding: 7bit
  11. X-Mailer: Mozilla 2.0 (X11; I; IRIX 5.3 IP22)
  12.  
  13. Hi there,
  14.  
  15. I have an interesting C++ problem that I was wondering if any guru out
  16. there knows the answer to....  
  17.  
  18. I am trying to create a template class that saves or reads data to/from
  19. a file.  This is not a problem for numeric data as fstream can cope with
  20. this no problem.  The problem I have is that when the template type is a
  21. string I have to create the space to store the data in. The only way I
  22. can see of doing this is to use a case statement in the template
  23. function but this is then removing all purpose of creating a template in
  24. the first place.
  25.  
  26. Does anyone know a way around this problem ?
  27.  
  28. John Kennedy
  29.  
  30. johnk@cs.york.ac.uk
  31.